<?php

function getLinksForUser($user){

  $con = mysql_connect ("localhost:3306", "root", "fli2411");
  if (!$con) {
    error(DB_ERR);
  }
  mysql_select_db("brain_browser", $con);
  $result = mysql_query("SELECT link FROM user_link WHERE user='$user'", $con);
  if (!$result) {
    error(DB_ERR);
  }
  
  else {
    //echo 'success<br>';
    $i = 0;
    while ($arr[$i] = mysql_fetch_array($result, MYSQL_NUM) )
	$i++;

    $i = 0;
    foreach ($arr as $link){
	    $retArr[$i] = $link[0];
	    $i++;
    }

    
    return $retArr;
  
  }

  mysql_close($con);


}

?> 
